#! /bin/sh

name=libtool
version=2.5.4
revision=1
tarball_url="https://ftp.gnu.org/gnu/libtool/libtool-${version}.tar.xz"
tarball_blake2b="47de3c49a690d44d7ddd5e3b5e4090c91dc5fbb9c40fc4a3963e150fb7329326ee3e21b8c149974726171c4b0380028e0efc7a369c4f04357eea46f69852e1cc"
hostdeps="gcc pkg-config"
deps="core-libs"

prepare() {
    autotools_recursive_regen
}

configure() {
    autotools_configure
}

build() {
    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

    sed -Ei "s|/sysroot(/)?|/|g;s|/${prefix}|/|g" "${dest_dir}${prefix}"/bin/libtool

    post_package_strip
}
